package com.hht.controller;

import com.hht.model.User;
import com.hht.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author hht
 * @ClassName UserController
 * @Description TODO
 * @Date 2019/4/18 10:57
 * @VERSION 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;


    @GetMapping("/saveUser")
    @ResponseBody
    public String getUser() {
        User user = new User();
        user.setName("张三");
        userService.saveUser(user);
        return "success";
    }
}
